package ua.openmedis.domain;

// Generated Aug 22, 2011 4:58:43 PM by Hibernate Tools 3.4.0.CR1

import java.util.HashSet;
import java.util.Set;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import static javax.persistence.GenerationType.IDENTITY;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;

/**
 * Districts generated by hbm2java
 */
@Entity
@Table(name = "districts", catalog = "openmedis_demo")
public class Districts implements java.io.Serializable {

	private Integer districtId;
	private Province province;
	private String districtName;
	private Set<Facilities> facilitieses = new HashSet<Facilities>(0);

	public Districts() {
	}

	public Districts(Province province) {
		this.province = province;
	}

	public Districts(Province province, String districtName,
			Set<Facilities> facilitieses) {
		this.province = province;
		this.districtName = districtName;
		this.facilitieses = facilitieses;
	}

	@Id
	@GeneratedValue(strategy = IDENTITY)
	@Column(name = "DistrictID", unique = true, nullable = false)
	public Integer getDistrictId() {
		return this.districtId;
	}

	public void setDistrictId(Integer districtId) {
		this.districtId = districtId;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "ProvinceID", nullable = false)
	public Province getProvince() {
		return this.province;
	}

	public void setProvince(Province province) {
		this.province = province;
	}

	@Column(name = "DistrictName")
	public String getDistrictName() {
		return this.districtName;
	}

	public void setDistrictName(String districtName) {
		this.districtName = districtName;
	}

	@OneToMany(fetch = FetchType.LAZY, mappedBy = "districts")
	public Set<Facilities> getFacilitieses() {
		return this.facilitieses;
	}

	public void setFacilitieses(Set<Facilities> facilitieses) {
		this.facilitieses = facilitieses;
	}

}
